<template>
  <div class="table-container">
    <page-list :pageOption="pageOption" ref="tablePage" />
  </div>
</template>

<script setup>
  import PageList from '../../../components/pageList/index.vue';

  const pageOption = {
    dataUrl: '/base/baseRel',
    immediate: false, //是否立即请求数据 默认true
    tree: {
      url: '/base/baseSuitunitOrg/findTree',
      title: '绩效考核部门',
      listStyle: true, //不要异步加载和搜索框,仅展示列表 默认false
      paramName: 'orgCodes',
      allChildNode: true,
      fieldNames: {
        title: 'orgName', //替换树默认显示title字段
        key: 'orgCode',
      },
    },
    //查询条件表单
    searchForm: [
      {
        field: 'orgCode',
        label: '部门名称',
        component: 'Input',
      },
      {
        field: 'orgCode',
        label: '任职岗位',
        component: 'Input',
      },
      {
        field: 'personType',
        label: '人员类型',
        component: 'Input',
      },
      {
        field: 'psnNum',
        label: '员工工号',
        component: 'Input',
      },
      {
        field: 'psnName',
        label: '员工姓名',
        component: 'Input',
      },
      {
        field: 'isAssess',
        label: '是否考核',
        component: 'Input',
      },
      {
        field: 'mainpos',
        label: '是否主岗',
        component: 'Input',
      },
      {
        field: 'orgTypeCode',
        label: '组织类型',
        component: 'Input',
      },
      {
        //todo 字段缺失
        field: 'director',
        label: '是否负责人',
        component: 'Input',
      },
    ],
    //数据列表表头
    columns: [
      {
        title: 'id',
        dataIndex: 'id',
        width: 80,
        ifShow: false,
      },
      {
        title: '部门名称',
        dataIndex: 'orgName',
        align: 'center',
      },
      {
        title: '任职岗位',
        dataIndex: 'posName',
        width: 200,
        align: 'center',
      },
      {
        title: '工号',
        dataIndex: 'psnNum',
        width: 200,
        align: 'center',
      },
      {
        title: '姓名',
        dataIndex: 'psnName',
        width: 200,
        align: 'center',
      },
      {
        title: '人员类型',
        dataIndex: 'personType',
        width: 200,
        align: 'center',
      },
      {
        title: '用工性质',
        dataIndex: 'personType',
        width: 200,
        align: 'center',
      },
      {
        title: '绩效部门',
        dataIndex: 'secOrgName',
        width: 200,
        align: 'center',
      },
      {
        title: '是否考核',
        dataIndex: 'isAssess',
        width: 200,
        align: 'center',
      },
      {
        title: '是否主岗',
        dataIndex: 'mainpos',
        width: 200,
        align: 'center',
      },
      {
        title: '是否负责人',
        dataIndex: 'director',
        width: 200,
        align: 'center',
      },
      {
        title: '排序',
        dataIndex: 'displayOrder',
        align: 'center',
        width: 100,
      },
      {
        title: '备注',
        dataIndex: 'remark',
        align: 'center',
        width: 200,
      },
    ],
    //新增编辑弹窗表单
    modalForm: [
      {
        field: 'id',
        label: 'id',
        component: 'Input',
        show: false,
      },
      {
        field: 'orgCode',
        label: '组织部门',
        component: 'Input',
        required: true,
      },
      {
        field: 'orgCode',
        label: '部门编码',
        component: 'Input',
      },
      {
        field: 'parentOrgName',
        label: '上级部门',
        component: 'Input',
      },
      {
        field: 'orgTypeName',
        label: '组织类型',
        component: 'Input',
      },
      {
        field: 'psnName',
        label: '部门负责人',
        component: 'Input',
      },
      {
        field: 'secOrgName',
        label: '绩效部门',
        component: 'Input',
      },
      {
        field: 'pluraList',
        label: '部门绩效兼职',
        component: 'Input',
      },
      {
        field: '',
        label: '绩效经理',
        component: 'Input',
      },
      {
        field: 'isAssess',
        label: '是否考核',
        component: 'ZSwitch',
      },
      {
        field: 'displayOrder',
        label: '排序',
        component: 'InputNumber',
      },
      {
        field: 'remark',
        label: '备注',
        component: 'InputTextArea',
      },
    ],
  };
</script>

<style scoped></style>
